
import 'children.dart';

class Citys{

  String code;
  String name;
  List<Children> children;

  Citys({this.code, this.name, this.children});

  Citys.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    name = json['name'];
    if (json['children'] != null) {
      children = new List<Children>();
      json['children'].forEach((v) {
        children.add(new Children.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['name'] = this.name;
    if (this.children != null) {
      data['children'] = this.children.map((v) => v.toJson()).toList();
    }
    return data;
  }

}
